#ifndef __i2c_h__
#define __i2c_h__

struct i2c {
	__u32	pid12;
	__u32	emumgt;
	__u32	na1;
	__u32	na2;
	__u32	tim12;
	__u32	tim34;
	__u32	prd12;
	__u32	prd34;
	__u32	tcr;
	__u32	tgcr;
	__u32	wdtcr;
};

// copied from addressmap.h to avoid including 
#define ADDR_RANGE_READ  1            // Bus read
#define ADDR_RANGE_WRITE 2           // Bus write
#define ADDR_RANGE_DEL   3           // delete an address range


#define I2C_ADDR_SIZE sizeof(struct i2c)

int i2c_init();
void i2c_do_clock();

void i2c_handler(
	  void *lpContext,
	  int op, 
	  unsigned int dwAddress,           // start dwAddress on 32bit bus
	  char *pszBuff,           // optional 
	  unsigned int nBytes );            // in or out buffer
#endif //__i2c_h__